<?php
	include 'init.php';

	if ($listid)
	{
		$con = mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
		mysql_select_db("$DBName", $con);

		if ($listid == 4)
		{
			mysql_query("DELETE FROM $TSendSMS");
		}
		else
		{
			mysql_query("DELETE FROM $TSendSMS WHERE ListId='$listid'");
		}
		mysql_close($con);

		$to = "/smsstatus/$listid/$fromphone";
		header('Location: '. $to);
	}
?>